November 20 2008 23:46:17 Home | Mod Downloads v6 | Mod Downloads v7 | Support Forum | Useful Resources | Articles | Dev log
 
Navigation
Home
Home
Articles
Search

Community
Mod Downloads v6
Mod Downloads v7
Support Forum
Contact Us

Information
News Categories
Useful Resources
Photo Gallery
Dev log
Site Map
Last Seen Users
MassaOnline
rushqoneOnline
rodjak< 5 mins
Drago< 5 mins
garagetalk< 5 mins
Wildformovies00:07:22
cylndwa00:21:09
proteus00:28:02
rudik00:29:10
snsboss00:29:52

Guests Online: 0
Registered Members: 2,573
Newest Member: rushqone
Latest Articles
Admin Control Panel Protection
How to Secure Your Importan...
Show Content by Default Use...
v7 | Add social bookmark to...
v7 | Custom MySQL error mes...
How To: A PM after registra...
v7 | SEO friendly URL's for...
v7 | SEO friendly URL's for...
Comments Advanced View and ...
Auto-redirect to the page v...
A tour through PHP-Fusion v...
Upgrading to PHP-Fusion v7 ...
SEO | Improve your PHP-Fusi...
Advertisements in article f...
Improving your photogallery...

View all articles
Downloads v7
Currently popular Downloads

Professional Downloa... 344
Extended Profile 330
Photoalbum Mass Upload 297
Photo in Profile 289
FusionBoard 4 276
HighSlide Gallery In... 274
Avatar Studio 257
Wap Mod 235
VArcade 1.7 226
Download System mSF 220

Latest Downloads


PHP-Fusion v7 Bosnia... 1
Memberlist with avatar 23
Orders script 7
Unactivated Users li... 4
Forum Ad Bot Agent 14
catsbyR5 news catego... 5
Qrmiz new category i... 3
Qrmiz news category ... 1
Clean set of news ca... 1
News Category Images... 0
Downloads v6
Currently popular Downloads

EXTboard 322
Video Gallery 302
Extreme Theme Editor 280
Icon Package 2.0 233
Fuzed Shoutbox 225
News.php 225
Tabbed welcome panel 221
Extended Profile 2.20 217
Header Banner System 177
Seoname.php 165

Latest Downloads


ExtBoard 1.1 67
Forum Attachment Admin 1
Extended User Search 1
CCMail Infusion 1
Advanced Search 92
Expose Photogallery 80
Who is online | Admin 110
Mark Threads As Read 2 10
Forum look without s... 46
Banner System v2.0.4 165
Provider
PHPfusion-mods.net is hosted at:

Security System 1.8.5 © 2006 by BS-Fusion Deutschland
CTracker - cback.de


SEO | Improve your PHP-Fusion forum rankings
In this tutorial I will explain you how to create SEO friendly URL's for your forum. This method is based on the same methods as the previous SEO friendly mod's. This mod requires the seoname.php file which you can download on this site. Below is a direct link.

This tutorial is written for the standard forum integrated in PHP-Fusion. In my next tutorial I will describe how to apply this mod to the advanced forum index by Shedrock and the EXTboard forum.

Before we can continue you must make sure that you have the following stuff available:

- seoname.php (download here)
- .htaccess support on your host
- PHP-Fusion 6.01.10 or higher. (probably works on lower version too but only tested with this version and higher)

When all above is available you can continue with this tutorial.

Don't forget to backup the files you modify before you continue!!!


SEO friendly links for the standard PHP-Fusion forum


Step 1
Download Seoname.php and upload that file to your includes folder.


Step 2
Create a new .htaccess file OR open yours if you already got one and paste the following code in it:

## SEO friendly URL by web-bureau.com
## Provided by PHPfusion-mods.net
## Use this if Fusion is installed in your root directory
RewriteBase /
## Use the following if Fusion is not installed on your root directory
## RewriteBase /<fusion_path>/
RewriteEngine On

## Forum categories
RewriteRule ^(.*)-fc([0-9]*).([0-9]*).htm$ forum/viewforum.php?forum_id=$2&rowstart=$3 [L,NC]

## Forum threads
RewriteRule ^(.*)-fc([0-9]*)-ft([0-9]*).htm$ forum/viewthread.php?forum_id=$2&thread_id=$3 [L,NC]

## Forum threads and posts
RewriteRule ^(.*)-fc([0-9]*)-ft([0-9]*)-fp([0-9]*).htm$ forum/viewthread.php?forum_id=$2&thread_id=$3&p_id=$4 [L,NC]

## Forum threads and pagation
RewriteRule ^(.*)-fc([0-9]*)-ft([0-9]*).([0-9]*).htm$ forum/viewthread.php?forum_id=$2&thread_id=$3&rowstart=$4 [L,NC]

## Forum threads and pagation and posts
RewriteRule ^(.*)-fc([0-9]*)-ft([0-9]*).([0-9]*)-fp([0-9]*).htm$ forum/viewthread.php?forum_id=$2&thread_id=$3&rowstart=$4&p_id=$5 [L,NC]

If your Fusion isn't in the root, replace 'RewriteBase' to 'RewriteBase /<fusion_path>/' (where <fusion_path> is the folder name).


Step 3
Open Maincore.php and find:

'?>'

Above, add the following:

// Search engine friendly URLs
// http://www.web-bureau.com/php-fusion-cms-c1.htm
require_once INCLUDES."seoname.php";



Step 4
Open forum/index.php and search for: (line 61)

<a href='viewforum.php?forum_id=".$data['forum_id']."'>

Replace with:

<a href='".FORUM.seoname($data['forum_name'])."-fc".$data['forum_id'].".0.htm'\">

Your now finished with editing the forum/index.php file. Save it and re-upload the file.




Step 5
Open forum/viewforum.php and search for: (line 94)

<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."'>

Replace with:

<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".htm'>

Find (line 98):

<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."&rowstart=$ctr'>


And replace with:

<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".".$ctr.".htm'>

Find (line 139):

<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."'>


And replace with:

<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".htm'>


Find (line 143):

<a href='viewthread.php?forum_id=$forum_id&thread_id=".$data['thread_id']."&rowstart=$ctr'>


And replace with:

<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".".$ctr.".htm'>


Your now finished with editing the forum/viewforum.php file. Save it and re-upload the file.




Step 6
Open forum/viewthread.php and search for: (line 42)

<a href='viewforum.php?forum_id=".$fdata['forum_id']."'>

Replace with:

<a href='".seoname($fdata['forum_name'])."-fc".$fdata['forum_id'].".0.htm'>

Save forum/viewthread.php and upload it.


End

Everything should work now, if you run in trouble, recheck the steps above. If you still have problems, see the support thread .

Based on coding by Meep-online and skdown.net.



Article Tags
SEO forum links seoname .htaccess rewrite rules PHP-Fusion modification
Comments
webadmin88 on October 26 2008 15:08:18
tdsii don't flatter yourself thinking someone is using particularly YOUR edits, its my estimate that all the people commenting here have the skills needed to do it by themselves
tdsii on October 21 2008 13:00:24
yea ur right i already did that in skdown.net but the thing is i forgot where i did the edits as it was long time ago, good thing to know that people are still using my edits.

I will share the files soon with u, hope u benifit from them.

Regards.
wadday on September 03 2008 10:47:24
here is the photo gallery and slide show panel i have done for SEO . PHP fusion v7 recommended to use this.

http://www.wadday.com/blog/forum/vi ... ad_id=34
wadday on September 03 2008 09:59:30
sorry i forgot to include the rewrite url, well here it is

old
profile.php?lookup=userid
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>

new
username-profile-3.htm
<a href='".seoname($member[1])."-profile-".$member[0].".htm'>".$data['user_name']."</a>
wadday on September 03 2008 09:52:23
Quote:
webadmin88 on July 05 2008 12:34:24
I am now trying to optimize the ?lookup also but I will make a package now and give you the link


Code:
##Profile
RewriteRule ^(.*)-profile-([0-9]*).htm$ profile.php?lookup=$2 [L]


is this you are looking for... well. this might different than this site.. but it work well

still seoname.php file will be required.
wadday on September 03 2008 09:48:17
does the .htm is identify by the SEO rather than .php
webadmin88 on July 05 2008 12:34:24
I am now trying to optimize the ?lookup also but I will make a package now and give you the link
Diemux on July 04 2008 22:21:46
Sweet -> I'm very interested! Can you PM me a download link?
webadmin88 on July 04 2008 21:53:38
Ok, I am ready with the Full forum optimization. I was wondering whether you want it or not :P

P.S. I optimized and changed the EXT board + the Advanced Index, changed really a lot of things so I can not make a tutorial here....only the ready files.
P.S.2 The optimized forum consists of:

Optimized Index Page, View Forum Page, View Thread Page, Optimized pagerow transitions, Optimized postify links and proper redirect after that, Optimized Forum Tree Panel, Optimized infusion that is used by the advanced index, optimized forum_jump, optimized rankings redirect and last but not least optimized moderation addition panel+optimized regular one

If you are interested call me
webadmin88 on July 03 2008 10:08:18
Well I think you undestimate me I made it working, but now I am working on full seo optimized Ext Board + Advanced Index. When I am ready I will send you the package. For now the index and most of the content is ready, still missing optimization in the postify result page and on the edit pages-patience is everything
Diemux on July 02 2008 16:10:11
Good idea! Let me know when you get it working (or not )
webadmin88 on July 02 2008 15:59:25
Hey, about the issue I have an idea. Why not making a simple new function in the core for the &rowstart problem. We can then call it. Here is what I mean:

Code:

function forumpagenav($start,$count,$total,$range=0,$link=""){
global $locale;
if ($link == "") $link = FUSION_SELF."?";
$res="";
$pg_cnt=ceil($total / $count);
if ($pg_cnt > 1) {
$idx_back = $start - $count;
$idx_next = $start + $count;
$cur_page=ceil(($start + 1) / $count);
$res.="<table cellspacing='1' cellpadding='1' border='0' class='tbl-border'>\n<tr>\n";
$res.="<td class='tbl2'><span class='small'>".$locale['052']."$cur_page".$locale['053']."$pg_cnt</span></td>\n";
if ($idx_back >= 0) {
if ($cur_page > ($range + 1)) $res.="<td class='tbl2'><a class='small' href='$link"."rowstart=0'><<</a></td>\n";
$res.="<td class='tbl2'><a class='small' href='$link"."rowstart=$idx_back'><</a></td>\n";
}
$idx_fst=max($cur_page - $range, 1);
$idx_lst=min($cur_page + $range, $pg_cnt);
if ($range==0) {
$idx_fst = 1;
$idx_lst=$pg_cnt;
}
for($i=$idx_fst;$i<=$idx_lst;$i++) {
$offset_page=($i - 1) * $count;
if ($i==$cur_page) {
$res.="<td class='tbl1'><span class='small'><b>$i</b></span></td>\n";
} else {
$res.="<td class='tbl1'><a class='small' href='$link"."rowstart=$offset_page'>$i</a></td>\n";
}
}
if ($idx_next < $total) {
$res.="<td class='tbl2'><a class='small' href='$link"."rowstart=$idx_next'>></a></td>\n";
if ($cur_page < ($pg_cnt - $range)) $res.="<td class='tbl2'><a class='small' href='$link"."rowstart=".($pg_cnt-1)*$count."'>>></a></td>\n";
}
$res.="</tr>\n</table>\n";

}
return $res;
}


This is exact copy of makepagenav function used, but named forumpagenav.

All we have to do is this function to add not &rowstart= variables, but to add .variable.htm the way it is in the replacing seo url. Then call this function from the viewthread.php instead of the default one. I will try that later today, since now I am at work but I think it should work slightly.

Regards,
AR
webadmin88 on June 29 2008 20:45:12
Here is a tip for you
You can manually add the <div> with the locals.

In the viewforum.php the representation of the pages of the threads is fine I mean if a thread has more than one page the redirection is done properly, so probably replacing this with a full list of the pages of the thread will be great.

Here is the script I am talking about:
Code:
if ($rowstart == 0) {
$result = dbquery(
"SELECT t.*, COUNT(p.post_id) AS thread_replies, tu1.user_name AS user_author, tu2.user_name AS user_lastuser FROM ".$db_prefix."threads t
LEFT JOIN ".$db_prefix."posts p USING(thread_id)
LEFT JOIN ".$db_prefix."users tu1 ON t.thread_author = tu1.user_id
LEFT JOIN ".$db_prefix."users tu2 ON t.thread_lastuser = tu2.user_id
WHERE t.forum_id='$forum_id' AND thread_sticky='1' GROUP BY thread_id ORDER BY thread_lastpost DESC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['thread_locked']) {
echo "<tr>\n<td align='center' width='25' class='tbl2'><img src='".THEME."forum/folderlock.gif' alt='".$locale['564']."'></td>";
} else {
if ($data['thread_lastpost'] > $lastvisited) {
$folder = "<img src='".THEME."forum/foldernew.gif' alt='".$locale['560']."'>";
} else {
$folder = "<img src='".THEME."forum/folder.gif' alt='".$locale['561']."'>";
}
echo "<tr>\n<td align='center' width='25' class='tbl2'>$folder</td>";
}
$reps = ceil($data['thread_replies'] / $threads_per_page);
$threadsubject = "<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".htm'>".$data['thread_subject']."</a>";
if ($reps > 1) {
$ctr = 0; $ctr2 = 1; $pages = "";
while ($ctr2 <= $reps) {
$pnum = "<a href='".seoname($data['thread_subject'])."-fc".$forum_id."-ft".$data['thread_id'].".".$ctr.".htm'>$ctr2</a> ";
$pages = $pages.$pnum; $ctr = $ctr + $threads_per_page; $ctr2++;
}
$threadsubject .= " - (".$locale['412'].trim($pages)."";
}
echo "<td class='tbl1'><img src='".THEME."forum/stickythread.gif' alt='".$locale['560']."' style='vertical-align:middle;'>
$threadsubject</td>


This properly displays when there are 2 or more pages in a thread. It is displayed in the viewforum.php and represents the thread title and additionally the pages beneath. So I was trying to get this into the viewthread.php and in that way replace the default div above with my own. The problem is that there is no way to present the page number out of how much..hmmm

Hope the ideas are enough I am still trying. Btw I made seo names and tags for the Advanced DB system that your site uses. Also for the Varcade, so if you are interested PM me.
Diemux on June 29 2008 17:41:07
Yeah, thats the reason I didn't modify that, I actually don't know how to do that at the moment. Still looking in to it and hopefully I get a fix for this.

Suggestions welcome
webadmin88 on June 29 2008 17:23:36
Hmm Diemux everything works great there is only one CON according to me...This is not ful MOD. You are missing edits on the postify.php, which appears after post and also

viewthread.php

There is this certain function ".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&"."

This is part of the creating of a table on the top with Page X of Y, and the links there you see still appear in the old format, However I really can not think how to alter this since makePageNav is part of the maincore and it by default adds &rowstart=....
I was thinking whether it is possible to achieve this? If you found a solution pls post..
Post Comment
Please Login to Post a Comment.
Ratings
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
PHP-Fusion Coders
Andrean Rashkov
Georgios
Diemux
Donate

Affiliates:


Shoutbox
You must login to post a message.

bullet Diemux 
20/11/2008 20:59
@sathishIPL: - I thought you meant the article (pm after registration). Anyhow, I have commented at the download.

bullet elyn 
20/11/2008 19:38
lol. diemux seems like an operator here. user : *dialed 1515-phpfusion-MODs operator (diemux) : for any enquiries.. please press 1 ... for *user press 1 operator(diemux) : for.. and it

bullet sathishIPL 
20/11/2008 15:29
I cant find .... as u said in article

bullet Diemux 
20/11/2008 12:32
Check the article comment please

bullet sathishIPL 
20/11/2008 10:35
Hi Diemux, The Mod Pm after Registration works for me...but i want to add the from ...where i can add thr from

Bullet Display More Shouts Bullet

bullet Diemux 
20/11/2008 02:12
@samaritean: - Check the "Orders script" in v7 downloads under Miscellaneous.

bullet Diemux 
20/11/2008 02:11
@gozoc, ratings is fixed, thanks . Couldn't find anything wrong with comments or redirect?

bullet samaritean 
19/11/2008 21:02
There is a infusion for sell cars ?To add cars in the forum as Infusion.

bullet gozoc 
19/11/2008 20:07
...and fix your redirect after post a shout to the download overview

bullet gozoc 
19/11/2008 20:06
diemux, please fix your download-ratings

Advertiser
One-click Translation

Powered by Google